﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BeniBastanYaratProject
{
    public partial class RastgeleUrun : System.Web.UI.UserControl
    {

        DBBaglantiDataContext db = new DBBaglantiDataContext();

        protected void Page_Load(object sender, EventArgs e)
        {
            var sorgu = (from x in db.Urunlers orderby db.Random() select x).FirstOrDefault();
            lblUrunAdi.Text = sorgu.UrunAdi;
            imgUrunResim.ImageUrl = sorgu.UrunResmiKucuk;
            lblFiyat.Text = sorgu.UrunSatisFiyati.ToString("C");

            linkUrunIsim.NavigateUrl = "UrunDetay.aspx?uid=" + sorgu.UrunID.ToString();
            linkurunResim.NavigateUrl = "UrunDetay.aspx?uid=" + sorgu.UrunID.ToString();
        }
    }
}